package com.stx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.stx.pojo.Record;
import org.apache.ibatis.annotations.*;

import javax.websocket.Session;
import java.util.List;

@Mapper
public interface RecordMapper extends BaseMapper<Record> {

    @Select("select * from r_record;")
    List<Record> getrecord();

    @Insert("insert into r_record(id,jud_id,pla_id,jud_name,pla_name,rec_score,rua_number,rec_date)"+
            "values (#{id},#{judId},#{plaId},#{judName},#{plaName},#{recScore},#{ruaNumber},#{recDate})")
    void add(Record record);

    @Update("update r_record set jud_id=#{judId},pla_id=#{plaId},jud_name=#{judName},pla_name=#{plaName},rua_number=#{ruaNumber},rec_score=#{recScore},rec_date=#{recDate} where id=#{id}")
    void updateID(Record record);

    @Delete("delete from r_record where id=#{id}")
    void deleteID(Integer id);

    @Select("select * from r_record where id=#{id}")
    Record getRecordBySession(Session session, Record record);

    @Insert("insert into r_record(rec_score) values (#{recScore}) where rec_id=#{recId}")
    void addScore(Record record);

  /*  @Insert("insert into r_record(rec_id,jud_id,pla_id,rec_score,rec_date) values (#{vc})")
    void addscore(Session session, Record record);*/
}
